<template>
  <section v-loading="loading" class="cms-body">
    <div class="cms-list-header flex-between">
    </div>
    <!-- 表格 -->
    <el-table :data="tableData" stripe style="width: 100%" @selection-change="checkIds">
      <el-table-column prop="id" label="id" width="100" align="center"></el-table-column>
      <el-table-column prop="verName" label="版本名称" width="180" align="center"></el-table-column>
      <el-table-column prop="verNo" label="版本号" width="180" align="center"></el-table-column>
      <el-table-column prop="verTitle" label="版本标题" width="180" align="center"></el-table-column>
      <el-table-column prop="verContent" label="版本内容" width="180" align="center"></el-table-column>
      <el-table-column prop="verUrl" label="版本地址" width="180" align="center"></el-table-column>
      <el-table-column prop="forceUpdate" label="强制更新" align="center" width="180">
        <div slot-scope="scope">
          <span v-if="scope.row.forceUpdate==1">强制</span>
          <span v-if="scope.row.forceUpdate==2">非强制</span>
        </div>
      </el-table-column>
      <el-table-column prop="updateTime" label="更新日期" align="center" width="180"></el-table-column>
      <el-table-column label="操作" align="center">
        <div slot-scope="scope">
          <cms-button type="edit" @click.native="routerLink('/appVersion/update','update',scope.row.id)"
                      v-perms="'/appVersion/update'"></cms-button>
        </div>
      </el-table-column>
    </el-table>
    <!-- 表格底部 -->
    <div class="cms-list-footer">
      <div class="cms-left">
      </div>
      <!-- cms分页组件 -->
      <cms-pagination :total="total" @change="getPages"></cms-pagination>
    </div>
  </section>
</template>

<script>
  import listMixins from '@/mixins/list'

  export default {
    mixins: [listMixins],
    data() {
      return {
        params: {//只需要业务参数
          pageNo: 1,
          pageSize: 10,
          isDisabled: '',
          keywordName: ''
        }

      };
    },
    methods: {
      batchUpdate(url) { //保存排列循序
        let params = [];
        for (let i in this.checkedList) {
          let param = this.checkedList[i];
          console.log(param)
          param['keywordId'] = param.id;
          params.push(param)
        }
        params = JSON.stringify(params);
        this.$confirm('是否保存?', '提示', {type: "warning"}).then(mes => {
          this.$http.post(url, {params: params}).then(res => {
            if (res.code == "200") {
              this.successMessage('操作成功');
              this.getTableData(this.params);
            }
          });
        }).catch(error => {
          console.log(error)
        });
      }
    },
    created() {
      this.initTableData(this.$api.sysVersionPageList, this.params);
    }
  };
</script>

<style>

</style>
